import { ref } from "vue";
import { defineStore } from "pinia";
import { useUserInfo } from "@/libs/useUserInfo";
import type { User } from "@/interface/User";

export const useUserInfoStore = defineStore("loginUser", () => {
  const _user = useUserInfo();
  const userInfo = ref(_user.value);
  const setUserInfo = (user:User.Data)=> {
    userInfo.value = user;
    _user.value = user;
  }

  return {setUserInfo, userInfo}
});
